package com.train.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.train.common.Const;
import com.train.common.ServerResponse;
import com.train.dao.CourseTypeMapper;
import com.train.pojo.CourseType;
import com.train.service.ICourseTypeService;

@Service
public class CourseTypeServiceImpl implements ICourseTypeService {

	@Autowired
	private CourseTypeMapper courseTypeMapper;
	public ServerResponse selectCourseTypeList() {
		List<CourseType> list = courseTypeMapper.selectCourseTypeList(Const.CourseTypeStatus.SHANGJIA);
		if(list.size()==0){
			return ServerResponse.createByErrorMessage("当前还没有任何课程分类");
		}
		return ServerResponse.createBySuccess(list);
	}

}
